// ... 在自动出价配置相关函数之后、编辑备注相关函数之前添加以下代码 ...

// C类转B类客户相关函数
const showConvertToBDialog = ref(false)
const convertForm = ref({
  experienceToAmountRatio: 100, // 经验值转金额比例，默认100点=1万円
  minAmount: 0,
  maxAmount: 0,
  auctionLimit: '1',
  remark: ''
})
const convertTarget = ref<any>(null)
const auctionLimitOptions = [
  { value: '1', label: '1倍' },
  { value: '2', label: '2倍' },
  { value: '3', label: '3倍' },
  { value: '5', label: '5倍' },
  { value: '10', label: '10倍' }
]

function openConvertToBDialog(member: any) {
  convertTarget.value = member
  // 计算默认的经验值转金额比例和金额范围
  convertForm.value.experienceToAmountRatio = 100 // 默认100点=1万円
  // 基于会员的经验值计算默认金额范围
  const defaultAmount = Math.floor(member.points / convertForm.value.experienceToAmountRatio)
  convertForm.value.minAmount = Math.max(0, defaultAmount - 5)
  convertForm.value.maxAmount = defaultAmount + 5
  convertForm.value.auctionLimit = '1' // 默认1倍
  convertForm.value.remark = ''
  
  showConvertToBDialog.value = true
}

async function confirmConvertToB() {
  if (!convertTarget.value) return
  
  // 验证输入
  if (!convertForm.value.experienceToAmountRatio || convertForm.value.experienceToAmountRatio <= 0) {
    ElMessage.warning('请输入有效的转换比例')
    return
  }
  if (convertForm.value.minAmount < 0 || convertForm.value.maxAmount < 0) {
    ElMessage.warning('金额范围不能为负数')
    return
  }
  if (convertForm.value.minAmount > convertForm.value.maxAmount) {
    ElMessage.warning('最小金额不能大于最大金额')
    return
  }
  
  try {
    // 这里应该调用API来转换会员类型
    console.log('转换C类会员到B类:', convertTarget.value.id, convertForm.value)
    
    // 模拟API调用成功
    await new Promise(resolve => setTimeout(resolve, 500))
    
    // 更新本地数据
    convertTarget.value.memberType = 'B'
    convertTarget.value.settlementType = 'JPY'
    
    ElMessage.success('会员类型转换成功')
    showConvertToBDialog.value = false
  } catch (error) {
    console.error('会员类型转换失败:', error)
    ElMessage.error('会员类型转换失败，请重试')
  }
}

// ... 现有代码继续 ...